package dao.notice;

import java.util.List;

import util.paramvo.MemberPageListParamVO;
import vo.NoticeVO;

import com.ibatis.sqlmap.client.SqlMapClient;

public class NoticeDAOImpl implements NoticeDAO{

	private SqlMapClient sqlMapClient;

	public void setSqlMapClient(SqlMapClient sqlMapClient) {
		this.sqlMapClient = sqlMapClient;
	}

	@Override
	public List<NoticeVO> getNoticeList(MemberPageListParamVO param) throws Exception {
		return sqlMapClient.queryForList("notice.getNoticeList", param);
	}

	@Override
	public int countNotice(int member_no) throws Exception {
		return (Integer) sqlMapClient.queryForObject("notice.countNotice", member_no);
	}

	@Override
	public void readNotice(int notice_no) throws Exception {
		sqlMapClient.update("notice.readNotice", notice_no);
	}

	@Override
	public void deleteNotice(int notice_no) throws Exception {
		sqlMapClient.delete("notice.deleteNotice", notice_no);
	}
	
}
